/**
 * 
 */
package org.t2.backstage.module.player.service;

import java.util.List;

import org.banish.sql.core.util.QuerySet;
import org.gaming.backstage.PageData;
import org.gaming.service.service.AbstractService;
import org.springframework.stereotype.Service;
import org.t2.backstage.module.player.model.WhiteList;

/**
 * @author YY
 *
 */
@Service
public class WhiteListService extends AbstractService<WhiteList> {

	public PageData<WhiteList> query(QuerySet querySet) {
		List<WhiteList> list = this.repository().getBaseDao().queryListWhere(querySet.getWhere(), querySet.getParams());
		
		PageData<WhiteList> pageData = new PageData<>();
		pageData.setCount(this.repository().getBaseDao().countWhere(querySet.getCountWhere(), querySet.getCountParams()));
		pageData.setData(list);
		return pageData;
	}
	
	//TODO 优化查询
	public WhiteList queryOne(QuerySet querySet) {
		return this.repository().getBaseDao().queryOneWhere(querySet.getWhere(), querySet.getParams());
	}

	@Override
	public void mergeServer(int mergeDbZoneId) {
		//不用实现
	}
	
	public WhiteList getEntity(long id) {
		return this.repository().getByKeys(id);
	}
	
	public void delete(WhiteList entity) {
		this.repository().delete(entity);
	}
}
